/* © 2007 Adobe Systems Incorporated. All rights reserved. */
package com.shubhjai.musiclib.controls
{
	import mx.controls.Image;
	import flash.display.Bitmap;
	import flash.events.Event;

	/**
	 * This class extends the Image component to invoke the 'complete' 
	 * event immediately when setting the source to an existing Bitmap object. 
	 */ 
	public class ExtendedImage extends Image
	{
		override public function set source(value:Object):void
		{
			super.source = value;
			if ( value != null && value is Bitmap && value != source )
			{
				dispatchEvent( new Event( "complete" ) );
			}
		}
	}
}